Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix metric checking tests #87

Merged
merged 2 commits into from
Mar 4, 2024
Merged

fix metric checking tests #87

merged 2 commits into from
Mar 4, 2024

Conversation

pirtleshell
Copy link
Member

test did not actually look for only listed methods. additionally, adds a small time buffer to alow metrics to finish being created.

test did not actually look for only listed methods.
additionally, adds a small time buffer to alow metrics to finish being
created.
main_test.go Outdated
@@ -88,7 +88,8 @@ var (
// search for any request metrics between startTime and time.Now() for particular request methods
// if testedmethods is empty, all metrics in timeframe are returned.
func findMetricsInWindowForMethods(db database.PostgresClient, startTime time.Time, testedmethods []string) []database.ProxiedRequestMetric {
endTime := time.Now()
// add small buffer into future in case metrics are still being created
endTime := time.Now().Add(100 * time.Millisecond)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could source from an environment variable and set to higher values in ci if tests are being flaky

@pirtleshell pirtleshell merged commit fcb274f into main Mar 4, 2024
4 checks passed
@pirtleshell pirtleshell deleted the rp-fix-metric-tests branch March 4, 2024 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants